#!/usr/bin/perl -w
use Data::Dump;
use SOAP::Lite;

my $soap =  SOAP::Lite
    -> service('http://lsamp.dyndns.org:8181/1080951/flights.wsdl')
    -> on_fault(sub { my($soap, $res) = @_; 
         die ref $res ? $res->faultstring : $soap->transport->status, "\n";
       });
my @res = $soap->checkSeatAvailability('EJ286', '03/10/2008');
$origin = $res[0];
if($origin eq NULL){
        $message = "No data return";
  }else{
          $res[3] =~ s/ / at /;
          $res[4] =~ s/ / at /;

          $message = "Flight from $origin to $res[1] \n";
          $message .= "Flight code EJ286 \n";
          $message .= "Using $res[2] \n";
          $message .= "Departure date on $res[3] \n";
          $message .= "Arriving date on $res[4] \n";
          $message .= "duartion of journey $res[5] \n";
          $message .= "With seat availability $res[6] in first, $res[7] in business, $res[8] in economy \n";
  }
  print $message;



